package com.jsoft.dao.impl;

import com.jsoft.dao.TicketDetailDao;
import com.jsoft.entity.TicketDetail;
import com.jsoft.util.DAO;

import java.util.List;

/**
 * @author:sha
 * @email:o68o4741@163.com
 * @date:2023/2/21
 */
public class TicketDetailDaoImpl extends DAO<TicketDetail> implements TicketDetailDao {
    @Override
    public TicketDetail getTicketDetail(Integer id) throws Exception {
        String sql="SELECT `no`,receiveEnterprise,receiveSocialUniformCode,openEnterprise,openSocialUniformCode,institution,openTime,transferTime,remark,`status`,progressStatus,amount,expiryTime,paymentInterestType FROM ticketdetail WHERE id = ?";
        return get(sql,id);
    }

    @Override
    public List findByTransferId(Integer id) throws Exception {
        String sql = "SELECT id FROM ticketdetail WHERE transfer_enterprise_id = ?";
        return getForList(sql, id);
    }
}
